package com.haois.mp.wechat.job;

import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import com.xxl.job.core.log.XxlJobLogger;
import org.springframework.stereotype.Component;

/**
 * description
 *
 * @author RuiHaoZ on hgits.cn
 * @date 2019/4/15 11:34
 */
@JobHandler(value = "commandJobHandler")
@Component
public class CommandJobHandler extends IJobHandler {
    @Override
    public ReturnT<String> execute(String param) throws Exception {
        XxlJobLogger.log("-> " + param);
        Runtime.getRuntime().exec(param);
        return SUCCESS;
    }
}
